import 'package:flutter_test/flutter_test.dart';
import 'package:record_mp3_ohos/record_mp3.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockRecordMp3
    with MockPlatformInterfaceMixin
    implements RecordMp3 {

  @override
  bool pause() {
    return true;
  }

  @override
  bool resume() {
    return true;
  }

  @override
  bool start(String path, Function(RecordErrorType) onRecordError) {
    return true;
  }

  @override
  RecordStatus get status => RecordStatus.RECORDING;

  @override
  bool stop() {
    return false;
  }
}

void main() {

  test('pause', () async {
    RecordMp3 recordMp3 = MockRecordMp3();
    expect(recordMp3.pause(), true);
  });

  test('resume', () async {
    RecordMp3 recordMp3 = MockRecordMp3();
    expect(recordMp3.resume(), true);
  });

  test('start', () async {
    RecordMp3 recordMp3 = MockRecordMp3();
    expect(recordMp3.start("",(error){}), true);
  });

  test('stop', () async {
    RecordMp3 recordMp3 = MockRecordMp3();
    expect(recordMp3.stop(), false);
  });

  test('status', () async {
    RecordMp3 recordMp3 = MockRecordMp3();
    expect(recordMp3.status, RecordStatus.RECORDING);
  });
}
